using System.Collections;
using UnityEngine;

public class Lightning1 : MonoBehaviour
{
	public Transform tf;

	public Rigidbody2D rb;

	public Animator at;

	public Collider2D col;

	public SpriteRenderer SR_IMG_AttackZone;

	public AttackInfo SCRT_AttackInfo;

	public void Init(float[] data)
	{
		base.gameObject.layer = (int)data[2];
		tf.localScale = new Vector2(data[0], 1f);
		SCRT_AttackInfo.weaponID = 0;
		SCRT_AttackInfo.power = (int)data[1];
		SCRT_AttackInfo.force = Vector2.zero;
		SR_IMG_AttackZone.enabled = false;
		col.enabled = false;
		Show();
	}

	public void Show()
	{
		StartCoroutine(IE_Show());
	}

	private IEnumerator IE_Show()
	{
		if (base.gameObject.layer == 12)
		{
			SR_IMG_AttackZone.enabled = true;
			yield return new WaitForSeconds(0.5f);
			SR_IMG_AttackZone.enabled = false;
			yield return new WaitForSeconds(0.1f);
		}
		at.Play("Lightning1Show", -1, 0f);
		Audio.instance.sfx[41].Play();
		for (int i = 0; i < 3; i++)
		{
			yield return new WaitForSeconds(0.05f);
			col.enabled = true;
			yield return new WaitForSeconds(0.09f);
			col.enabled = false;
		}
		DeActive();
	}

	public void DeActive()
	{
		base.gameObject.SetActive(false);
	}
}
